<?php
namespace Rate\Controller;
use Todo\Controller\CurdController;

class RecordController extends CurdController {
    
    public function view(){
        $id = I('get.id');
        if(!$id) $this->error('非法请求!');
        $data = $this->_editData($id);
        $this->assign('data', $data);

        $project = D('Todo/Rate/Project')->keyFind($data['project_id']);
        $this->assign('project', $project);

        $scoreList = $this->_model->query("SELECT n.title,s.score FROM rate_norm n JOIN rate_score s ON s.norm_id=n.id WHERE s.record_id=".$data['id']);
        $this->assign('scoreList', $scoreList);

        $this->display();
    }
}